//
// Created by wkm on 2024-04-17.
//

#include "contrary_sbox.h"

void contrary_sbox::prc_contrary_sbox() {
    if (en_read) {
        out_data1 = CONTRARY_SBOX_DATA[addr1.read()];
        out_data2 = CONTRARY_SBOX_DATA[addr2.read()];
        out_data3 = CONTRARY_SBOX_DATA[addr3.read()];
        out_data4 = CONTRARY_SBOX_DATA[addr4.read()];
        out_data5 = CONTRARY_SBOX_DATA[addr5.read()];
        out_data6 = CONTRARY_SBOX_DATA[addr6.read()];
        out_data7 = CONTRARY_SBOX_DATA[addr7.read()];
        out_data8 = CONTRARY_SBOX_DATA[addr8.read()];
        out_data9 = CONTRARY_SBOX_DATA[addr9.read()];
        out_data10 = CONTRARY_SBOX_DATA[addr10.read()];
        out_data11 = CONTRARY_SBOX_DATA[addr11.read()];
        out_data12 = CONTRARY_SBOX_DATA[addr12.read()];
        out_data13 = CONTRARY_SBOX_DATA[addr13.read()];
        out_data14 = CONTRARY_SBOX_DATA[addr14.read()];
        out_data15 = CONTRARY_SBOX_DATA[addr15.read()];
        out_data16 = CONTRARY_SBOX_DATA[addr16.read()];
        done = task_finished;
    } else {
        done = waiting_task;
    }
}